const {
	resolve,
	isMp
} = require('./shared')

/** @type {import('tailwindcss').Config} */
module.exports = {
	// 需要tailwindcss提取的文件源，假如你把组件加到了另外的文件，则需要在下方添加表达式
	content: ["./index.html",'./src/**/*.vue'].map(resolve),
	theme: {
		// 内边距
		padding: Array.from({
			length: 1000
		}).reduce((map, _, index) => {
			map[index] = `${index}px`
			return map
		}, {}),
		// 外边距
		spacing: Array.from({
			length: 1000
		}).reduce((map, _, index) => {
			map[index] = `${index}px`
			return map
		}, {}),
		// 圆角
		borderRadius: Array.from({
			length: 1000
		}).reduce((map, _, index) => {
			map[index] = `${index}px`
			return map
		}, {}),
		extend: {
			borderOpacity:{},
			// 宽度
			width: Array.from({
				length: 1000
			}).reduce((map, _, index) => {
				map[index] = `${index}px`
				return map
			}, {}),
			// 高度
			height: Array.from({
				length: 1000
			}).reduce((map, _, index) => {
				map[index] = `${index}px`
				return map
			}, {}),
			// 字体大小
			fontSize: Array.from({
				length: 100
			}).reduce((map, _, index) => {
				map[index] = `${index}px`
				return map
			}, {}),
			// 行高
			lineHeight: Array.from({
				length: 1000
			}).reduce((map, _, index) => {
				map[index] = `${index}px`
				return map
			}, {}),
			animation: { //自定义动画
				'icon-bounce': 'icon-bounce 3s infinite'
			},
			keyframes: {
				'icon-bounce': {
					'0%': {
						transform: 'translateY(-5%)',
						animationTimingFunction: 'cubic - bezier(0.8, 0, 1, 1)'
					},
					'50%': {
						transform: 'translateY(0)',
						animationTimingFunction: 'cubic - bezier(0, 0, 0.2, 1)'
					},
					'100%': {
						transform: 'translateY(-5%)',
						animationTimingFunction: 'cubic - bezier(0.8, 0, 1, 1)'
					}
				}
			},
			colors: {
				'white':'#ffffff'
			}
		}
	},
	important: false,
	plugins: [],
	corePlugins: {
		//以下部分安卓机型不适配--生成的css包含自定义变量，安卓机无法识别
		preflight: !isMp,
		container: !isMp,
		backgroundOpacity: false,//去掉背景里的自定义变量
		textOpacity: false,
		borderOpacity:false,
		gridTemplateColumns:false,
		gridTemplateRows:false,
		gradientColorStops:false,
		// 以下功能小程序不支持  
		space: false, // > 子节点选择器  
		divideWidth: false,
		divideColor: false,
		divideStyle: false,
		divideOpacity: false
	}
};